# -*- coding: utf-8 -*-
"""
Version: 0.1
Author: CarpeDiem
Date: 2022/3/26
Description: 打印每月销售明细
"""


class Month_Sales:
    # 销售明细 列表
    account = (
        ("T0001", "笔记本电脑"),
        ("T0002", "华为荣耀X6"),
        ("T0003", "iPad"),
        ("T0004", "华为荣耀V9"),
        ("T0005", "MacBook"),
    )

    # 初始化方法
    def __init__(self, search_month):
        # 判断输入的月份
        if search_month == "2":
            print("\n" + search_month + "月份的商品销售明细如下：")
            for i in range(len(Month_Sales.account)):
                print("{}{}  {}{}".format("商品编号：", Month_Sales.account[i][0],
                                          "商品名称：", Month_Sales.account[i][1]))
        else:
            print("\n该月份没有销售数据或者输入的月份有误！")
        month = input("\n请输入要查询的月份（如：1、2、3等:)")
        Month_Sales(month)


# 创建实例
print("-" * 10, "销售明细", "-" * 10)
user_search_month = input("请输入要查询的月份（如：1、2、3等:)")
Month_Sales(user_search_month)